package com.zbkj.common.enums;

import com.google.common.collect.Lists;
import lombok.Getter;

import java.util.List;
import java.util.Objects;

/**
 * @Auther:
 * @Date: 2024/9/15 19:22
 * @Description:
 */
public enum OrderStatusEnum {

    //1待处理 2 已开通 3 已拒绝 4 超时取消, 5手工取消
    ORDER_STATUS1(1),
    ORDER_STATUS2(2),
    ORDER_STATUS3(3),
    ORDER_STATUS4(4),
    ORDER_STATUS5(5);

    @Getter
    private int status;
    OrderStatusEnum(int status) {
        this.status =status;
    }

    public static boolean voucheSaveStatusCheck(Integer status) {
        return Objects.nonNull(status) && (ORDER_STATUS1.getStatus() == status
                        || ORDER_STATUS3.getStatus() == status);
    }

    public static List<Integer> tfCodeRepeatCheckStatus() {
        return Lists.newArrayList(ORDER_STATUS1.getStatus(),ORDER_STATUS2.getStatus());
    }

    public static boolean isOrderStatus1(Integer status) {
        return Objects.nonNull(status) && ORDER_STATUS1.getStatus() == status;
    }
    public static boolean isOrderStatus2(Integer status) {
        return Objects.nonNull(status) && ORDER_STATUS2.getStatus() == status;
    }

    public static boolean isOrderStatus3(Integer status) {
        return Objects.nonNull(status) && ORDER_STATUS3.getStatus() == status;
    }
}
